# Author   : zhen.fang
# Time     : 2021/1/6 01:20
# Email    : fangeddie@163.com
import random


class RandomCooking:
    def __init__(self):
        self.letters = 'abcdefghijkmnopqrstuvwxyz'
        self.letters_upper = 'QAZWSXEDCRFVTGBYHNUJMIKOLP'
        self.digits = '0123456789'

    def salad(self, length):
        vegetable = self.letters + self.digits + self.letters_upper
        return ''.join(random.sample(vegetable, length))

    def pure_digit(self, length):
        return ''.join(random.sample(self.digits, length))


if __name__ == '__main__':
    """指定长度随机数"""
    rc = RandomCooking()
    print(rc.salad(7))
    print(rc.pure_digit(6))
